package com.google.code.bankagregator.adapter.bank.forum.parser;

import com.google.code.bankagregator.adapter.exception.AdapterConnectException;
import com.google.code.bankagregator.entities.Bank;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * User: kirill
 * Date: 22.06.13
 * Time: 4:20
 * To change this template use File | Settings | File Templates.
 */
public class FuncForCredParser {
    public Document con = null;
    private Bank bank = null;

    public FuncForCredParser(String url) throws AdapterConnectException {
        bank = new Bank();
        bank.setName("ПАТ \"БАНК ФОРУМ\"");
        bank.setUrl("http://www.forum.ua/forumua/ua/mainnavigation/home/home.html");
        try {
            con = Jsoup.connect(url).timeout(5000).get();
        } catch (IOException e) {
            throw new AdapterConnectException(e.getMessage());
        }
    }
}
